home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d22 / csap208b.arc / DOSSTRUC.H < prev    next >
Text File  |  1989-10-10  |  3KB  |  120 lines

  1. /*  DpbStruct -- Layout of parameter block returned by Int 21H, Fn 32H    */
  2. /*               This function is an undocumented MS-DOS service but has  */
  3. /*               been verified to work correctly on PC/MS-DOS 2.0 through */
  4. /*               PC/MS-DOS 3.3                                            */
  5.  
  6. struct DpbStruct {
  7.     char     Designator;           /* Drive # (0=A, 1=B, ...)       */
  8.     char     AltDesignator;        /* As above; 0 if RAMdisk        */
  9.     unsigned SectorSize;        /* Bytes per Sector              */
  10.     char     ClusterSize;          /* Sectors per Cluster - 1       */
  11.     char     ClusterShift;         /* Log2 (Sectors per Clus)       */
  12.     unsigned FatStart;            /* Sectors in Boot Record        */
  13.     char     FatCopies;            /* Copies of FAT                 */
  14.     unsigned MaxEntries;        /* Max entries in Root Directory */
  15.     unsigned DataStart;            /* 1st sector of data area       */
  16.     unsigned LastCluster;        /* Last cluster number           */
  17.     char     FatSize;            /* Sectors in FAT                */
  18.     unsigned DirStart;            /* 1St sector in Root Directory  */
  19.     long     ddh;                /* Internal use (?)              */
  20.     unsigned MediaType;            /* Disk type code                */
  21.     long     NextTable;            /* chain to next disk table      */
  22.     };
  23.  
  24. /*
  25.  *  MsDate -- packed date format used in directory
  26.  */
  27. struct MsDate {
  28.     unsigned d : 5;
  29.     unsigned m : 4;
  30.     unsigned y : 7;
  31.     };
  32.  
  33. /*
  34.  *  MsTime -- packed time format used in directory
  35.  */
  36. struct MsTime {
  37.     unsigned xx : 5;
  38.     unsigned mm : 6;
  39.     unsigned hh : 5;
  40.     };
  41.  
  42. /*  ExtendedHeader -- header used in constructing an
  43.  *                     extended file control block.
  44.  */
  45.  
  46. struct ExtendedHeader {
  47.     char Header;
  48.     char Zeros[5];
  49.     char Attrib;
  50.     };
  51.  
  52. /*  ExtFcb -- extended file control block */
  53.  
  54. struct ExtFcb {
  55.     struct ExtendedHeader FcbHdr;
  56.     char DriveId;
  57.     char FileName[8];
  58.     char FileExtension[3];
  59.     unsigned CurBlock;
  60.     unsigned RecSize;
  61.     long FileSize;
  62.     struct MsDate Date;
  63.     struct MsTime Time;
  64.     char Reserved[8];
  65.     char RecInBlock;
  66.     long RelRecord;
  67.     };
  68.  
  69. /*
  70.  *  DirDta -- dta directory entry structure
  71.  */
  72.  
  73. struct DirDta {
  74.     char DriveNum;
  75.     char FileName[11];
  76.     char Attributes;
  77.     char Unused[10];
  78.     struct MsTime CreateTime;
  79.     struct MsDate CreateDate;
  80.     unsigned FirstCluster;
  81.     long FileSize;
  82.     };
  83.  
  84. /*
  85.  *  DirEntry -- format of an entry in the directory
  86.  */
  87.  
  88. struct DirEntry {
  89.     unsigned char      Name[8];
  90.     char      Ext[3];
  91.     char      Attribute;
  92.     char      Reserved[10];
  93.     unsigned  ModifyTime;
  94.     unsigned  ModifyDate;
  95.     unsigned  FirstCluster;
  96.     long      FileSize;
  97.     };
  98.  
  99. /*
  100.  *  ExtendedEntry -- directory structure for use with
  101.  *                    extended file search
  102.  */
  103.  
  104. struct ExtendedEntry {
  105.     struct ExtendedHeader DirHdr;
  106.     struct DirDta Body;
  107.     };
  108.  
  109. struct ClusterEntry {
  110.     struct ClusterEntry *Next;
  111.     unsigned Cluster;
  112.     };
  113.  
  114. struct ClusterQueue {
  115.     struct ClusterEntry *Head, *Current;
  116.     int Count;
  117.     };
  118.  
  119.  
  120.